package com.example.finalassignment.pojo.response;

/**
 * 携带有数据的返回类
 * @param <T>
 */

public class ResultDataResponse<T> extends ResultResponse {

    /**
     * 返回的数据
     */
    private T data;

    public ResultDataResponse() {

    }

    public ResultDataResponse(T data) {
        super(200, "查询成功", Boolean.TRUE);
        this.data = data;
    }
    public ResultDataResponse(T data, String message) {
        super(200, message, Boolean.TRUE);
        this.data = data;
    }

    public ResultDataResponse(T data, String message,Boolean isSuccess) {
        super(200, message, isSuccess);
        this.data = data;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "ResultDataResponse{" +
                "data=" + data +
                '}';
    }
}
